<!DOCTYPE html>
<html lang="en">
<head>
    <include file="Common/top_pay"/>
    <include file="Common/import_plugins"/>
    <link rel="stylesheet" href="/Public/Home/css/pay.css">
</head>
<body>
<include file="Common/nav_menu_pay"/>
<form action="{:U('do_pay')}" method="post" style="padding-bottom: 80px">
    <input type="hidden" name="ticket_id" value="{:I('ticket_id')}">
    <input type="hidden" name="goods_name" value="{$info.title}">
    <input type="hidden" name="goods_id" value="{$info.pid}">
    <input type="hidden" name="seller_id" value="{$info.lid}">
    <input type="hidden" name="goods_sn" value="piaofutong_{$info.pid}">
    <input type="hidden" name="order_code"  value="{$order_code}">
    <input type="hidden" name="price"  value="{$real_price.retail_price}">
    <input type="hidden" name="totalPrice" value="{$real_price.retail_price}">
    <div class="box">
        <div class="container">
            <div class="top">
                <div class="title_text">
                    {$info.title}
                    <div class="price">
                        <span class="icon">￥</span>
                        <span id="price">
                            {$real_price.retail_price}
                        </span>
                    </div>
                </div>
            </div>
            <div class="mid clear">
                <div class="layui-row">
                    <div class="layui-col-xs7">
                        <div class="tips clear">
                            <div class="tip">
                                <span class="layui-icon">&#x1005;</span>
                                <span class="text">随时退</span>
                            </div>
                            <div class="tip">
                                <span class="layui-icon">&#x1005;</span>
                                <span class="text">入园保障</span>
                            </div>
                        </div>
                        <div class="notice">
                            购买须知 >
                        </div>
                    </div>
                    <div class="layui-col-xs5">
                        <div class="num">
                            <input type="text" class="num_text" name="num" value="1">
                        </div>
                    </div>
                </div>
            </div>
            <div class="bottom">
                由于系统逻辑问题，同一日期同一身份证仅限购买一张票（包括其他网络渠道），如需购买多张，请更换身份证号。本票种同一身份证一年只可购买一次。
            </div>
        </div>
    </div>

    <div class="box">
        <div class="form_title">
            出品人信息
        </div>
        <div class="container layui-form-item payer_info">
            <div class="layui-inline">
                <label class="layui-form-label">中文姓名</label>
                <div class="layui-input-inline">
                    <input type="text" name="real_name" autocomplete="off" class="layui-input" placeholder="需与证件上的名字一致">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">手机</label>
                <div class="layui-input-inline">
                    <input type="text" name="mobile" lay-verify="required|phone" autocomplete="off" class="layui-input" placeholder="请填写手机号" value="{:session('user')['phone']}">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">身份证</label>
                <div class="layui-input-inline">
                    <input type="text" name="certificate_no" autocomplete="off" class="layui-input" placeholder="请填写证件号码">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">游玩时间</label>
                <div class="layui-input-inline">
                    <input type="date" name="playtime" autocomplete="off" class="layui-input" placeholder="请填写游玩时间" value="{:date('Y-m-d',time())}">
                </div>
            </div>
        </div>
    </div>

    <div class="submit">
        <div class="layui-row">
            <div class="layui-col-xs8" id="price_box">
                总额: ￥<span id="totalPrice">{$real_price.retail_price}</span>
            </div>
            <div class="layui-col-xs4">
                <input type="submit" value="去支付">
            </div>
        </div>
    </div>
</form>
<script>
    layui.use(['form'], function () {
        var form = layui.form;

        // 修改金额
        $('input[name=num]').change(function () {
            var price = $('span#price').html();
            var total_price = Number($(this).val()) * Number(price);
            $('span#totalPrice').html(total_price);
            $('input[name=totalPrice]').val(total_price);
        })
    });

</script>
<script src="/Public/Home/js/common.js"></script>
</body>
</html>